package com.capsulode.excel.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Indicate a field which read the same column cell value as specified `Header`.
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Header {
    String EMPTY = "";

    /**
     * Header name.
     */
    String value();

    /**
     * format pattern when used.
     */
    String pattern() default "";

    /**
     * use a dictionary to map this field to Integer.
     *
     * @return A dictionary array.
     */
    String[] dictionary() default {};

    /**
     * Indicate this field is money specified that always do some conversion between currency units.
     */
    Currency currency() default Currency.NONE;

    /**
     * Specify which index at the column of this header.
     * `-1` means guessed by SheetReader.
     */
    int columnIndex() default -1;

    enum Currency {
        /**
         * Default currency, do nothing.
         */
        NONE,
        /**
         * Will covert value from `元` to `分`.
         */
        RMB
    }
}
